-
Notifications
You must be signed in to change notification settings - Fork 240
Improve UPDATES query for Platform #2132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| { | ||
| var results = new World[count]; | ||
|
|
||
| var ids = new int[count]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given how small this array is, could we stackalloc it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right here probably (I had tried on the update method at first), there is a MemoryExtensions method to do that on spans.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got confused by the diff but we can't do this in the updates scenario because we need to pass the ids array as a parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ArrayPool then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Npgsql supports ReadOnlyMemory<byte> (and I think of char too?), though IIRC it doesn't support mapping arrays of arbitrary types via ROM - might be worth trying just in case I'm misremembering.
(ArrayPool sounds good if not!)
No description provided.